Crate liquid [] [src]

The Liquid templating language for Rust

http://liquidmarkup.org/

[dependencies]
liquid = "0.9"

Example

use liquid::{Renderable, Context, Value};

let template = liquid::parse("Liquid! {{num | minus: 2}}", Default::default()).unwrap();

let mut context = Context::new();
context.set_val("num", Value::Num(4f32));

let output = template.render(&mut context);
assert_eq!(output.unwrap(), Some("Liquid! 2".to_string()));

Modules

lexer

Lexer

parser

Parser

Structs

Context
LiquidOptions

Options that liquid::parse takes

LocalTemplateRepository

TemplateRepository to load files relative to the root

Template

Enums

Error
FilterError
Token
Value

An enum to represent different value types

Traits

Renderable

Any object (tag/block) that can be rendered by liquid must implement this trait.

TemplateRepository

Functions

parse

Parses a liquid template, returning a Template object.

parse_file

Parse a liquid template from a file, returning a Result<Template, Error>.

Type Definitions

Array

Type representing a Liquid array, payload of the Value::Array variant

Block

A trait for creating custom custom block-size tags ({% if something %}{% endif %}). This is a simple type alias for a function.

Object

Type representing a Liquid object, payload of the Value::Object variant

Tag

A trait for creating custom tags. This is a simple type alias for a function.